﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace WAVEZ
{
    class Menu : SceneBase 
    {
        //antiga metologia

        //Texture2D cenario,cenario2;
        //Texture2D cenario;
        //Texture2D fundo, title, creditos, newGame;/
        
        Objeto2D cenario;
       // Objeto2D fundo, title, creditos, newGame;

        
        public override void start()
        {




            cenario = new Objeto2D(Game1.Self.Content.Load<Texture2D>("menu"));
            cenario.posicao.X = 400;
            cenario.posicao.Y = 240;
            //creditos = Game1.Self.Content.Load<Texture2D>("creditos");
          //  title = Game1.Self.Content.Load<Objeto2D>("menu");
          //  newGame = Game1.Self.Content.Load<Objeto2D>("newGame");
            


            
            



        }


        public override void draw(SpriteBatch spriteBatch)
        {
            // 
            
            //spriteBatch.Draw(cenario, Vector2.Zero, Color.White);
           // spriteBatch.Draw(cenario2,Vector2.Zero,Color.White);
           // spriteBatch.Draw(creditos, Vector2.Zero, Color.White);
           // spriteBatch.Draw(newGame, Vector2.Zero, Color.White);

            //met1 DO meu outro prgetos
            spriteBatch.Begin();
            cenario.Draw(spriteBatch);
            spriteBatch.End();
          //  title.Draw(spriteBatch);
           // newGame.Draw(spriteBatch);

            
            //spriteBatch.Draw(title, Vector2.Zero, Color.White);
            

        }


        public override void update(GameTime gameTime)
        {

            Game1.Self.KeyboardAtual = Keyboard.GetState();

            if (((Game1.Self.KeyboardAtual.IsKeyDown(Keys.Enter)) && !Game1.Self.KeyboardAntigo.IsKeyDown(Keys.Enter))) //&& (isGameLevel == true))
            {
                SceneManager.setScene(new Nivel_Teste(), true);
            }

            Game1.Self.KeyboardAntigo = Game1.Self.KeyboardAtual;
           

            if(Keyboard.GetState().IsKeyDown(Keys.Space))

             {
                 SceneManager.setScene(new intro(), true);

             }
            
            //controle 

            

           if (GamePad.GetState(PlayerIndex.One).Buttons.Start ==  ButtonState.Pressed)
           {

               SceneManager.setScene(new intro(),true);

           }



        }


        public override void terminate()
        {

        }
    }
}
